home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / autoit / autoit-v3.2.0.1-setup.exe / Examples / Helpfile / _GUICtrlTreeViewDeleteItem.au3 < prev    next >
Text File  |  2006-06-17  |  1KB  |  36 lines

  1. #include <GuiTreeView.au3>
  2.  
  3. opt("MustDeclareVars", 1)
  4. opt("GUIDataSeparatorChar", "\")
  5. Dim $h_GUI, $treeview, $nItem1, $nItem2, $nSubItem1, $nSubItem2, $nSubItem3, $nSubItem4
  6. Dim $Btn_Delete, $Btn_DeleteItem, $Msg
  7.  
  8. $h_GUI = GUICreate("TreeView Delete Item", 392, 254)
  9.  
  10. $treeview = GUICtrlCreateTreeView(10, 10, 150, 150)
  11. $nItem2 = GUICtrlCreateTreeViewItem("Item2", $treeview)
  12. $nItem1 = GUICtrlCreateTreeViewItem("Item1", $treeview)
  13. $nSubItem2 = GUICtrlCreateTreeViewItem("SubItem2", $nItem1)
  14. $nSubItem1 = GUICtrlCreateTreeViewItem("SubItem1", $nItem1)
  15. $nSubItem3 = GUICtrlCreateTreeViewItem("SubItem3", $nSubItem1)
  16. $nSubItem4 = GUICtrlCreateTreeViewItem("SubItem4", $nSubItem3)
  17.  
  18. $Btn_Delete = GUICtrlCreateButton("Delete Selected", 70, 170, 90, 20)
  19. $Btn_DeleteItem = GUICtrlCreateButton("Delete SubItem4", 70, 200, 90, 20)
  20.  
  21. GUISetState()
  22.  
  23. While 1
  24.     $Msg = GUIGetMsg()
  25.     Select
  26.         Case $Msg = $GUI_EVENT_CLOSE
  27.             ExitLoop
  28.         Case $Msg = $Btn_Delete
  29.             _GUICtrlTreeViewDeleteItem ($h_GUI, $treeview)
  30.         Case $Msg = $Btn_DeleteItem
  31.             _GUICtrlTreeViewDeleteItem ($h_GUI, $treeview, $nSubItem4)
  32.     EndSelect
  33. WEnd
  34.  
  35. Exit
  36.